package com.teradyne.merlin2.ui.server.models;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("serial")
public class OrderRequest implements Serializable {

	private SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy");

	private int orderRequestId;
	private int orderRequestNo;
	private String orderRequestStatus;
	private String userId;
	private String bpelInstanceNo;
	private ArrayList<OrderHeader> orderHeaders;
	private String dateCreated;
	private String[] invalidReason;
	private Long requestType;
	private String createdBy;
	private String taskId;

	public OrderRequest() {
	}

	public int getOrderRequestId() {
		return orderRequestId;
	}

	public void setOrderRequestId(int orderRequestId) {
		this.orderRequestId = orderRequestId;
	}

	public void setOrderRequestNo(int orderRequestNo) {
		this.orderRequestNo = orderRequestNo;
	}

	public int getOrderRequestNo() {
		return orderRequestNo;
	}

	public void setOrderRequestStatus(String orderRequestStatus) {
		this.orderRequestStatus = orderRequestStatus;
	}

	public String getOrderRequestStatus() {
		return orderRequestStatus;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserId() {
		return userId;
	}

	public String getBpelInstanceNo() {
		return bpelInstanceNo;
	}

	public void setBpelInstanceNo(String bpelInstanceNo) {
		this.bpelInstanceNo = bpelInstanceNo;
	}

	public void setOrderHeaders(ArrayList<OrderHeader> orderHeader) {
		this.orderHeaders = orderHeader;
	}

	public List<OrderHeader> getOrderHeaders() {
		return orderHeaders;
	}

	public String getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(String dateCreated) {
		this.dateCreated = dateCreated;
	}

	public String[] getInvalidReason() {
		return invalidReason;
	}

	public void setInvalidReason(String[] invalidReason) {
		this.invalidReason = invalidReason;
	}

	public Long getRequestType() {
		return requestType;
	}

	public void setRequestType(Long requestType) {
		this.requestType = requestType;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getTaskId() {
		return taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

//	public void copy(com.teradyne.merlin2.business.service.webservice.OrderRequest businessOrderRequest) {
//		this.bpelInstanceNo = businessOrderRequest.getBpelInstanceNumber() != null ? businessOrderRequest.getBpelInstanceNumber() : "";
//		this.createdBy = businessOrderRequest.getCreatedBy() != null ? businessOrderRequest.getCreatedBy() : "";
//		this.dateCreated = businessOrderRequest.getCreatedDate() != null ? dateFormat.format(businessOrderRequest.getCreatedDate().getTime()) : "";
//		this.orderRequestStatus = businessOrderRequest.getStatus() != null ? businessOrderRequest.getStatus().getStatus() : "";
//		this.orderRequestNo = (int) businessOrderRequest.getRequestId();
//		this.orderRequestId = (int) businessOrderRequest.getRequestId();
//		this.userId = businessOrderRequest.getCreatedBy() != null ? businessOrderRequest.getCreatedBy() : "";
//
//		ArrayList<OrderHeader> listOrderHeader = new ArrayList<OrderHeader>();
//		for (final com.teradyne.merlin2.business.service.webservice.PartRequestHeader partRequestHeader : businessOrderRequest.getPartRequestHeaders()) {
//			OrderHeader orderHeader = new OrderHeader();
//			orderHeader.copy(partRequestHeader, businessOrderRequest);
//			listOrderHeader.add(orderHeader);
//		}
//	}

}
